
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <!--<div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Work_warranty_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-work_warranty_id" data-rule="required" data-source="work/warranty/index" class="form-control selectpage" name="row[work_warranty_id]" type="text" value="">
        </div>
    </div>-->
    <style>

        .all_one_div {
            border-left: 2px solid #1f83fb;
            padding-left: 20px;
            margin-bottom: 10px;
        }
    </style>
    <div class="all_one_div"><b>工程师</b></div>
    <div class="form-group row">
        <div class="col-xs-12">
            <table class="table fieldlist" data-template="basictpl" data-name="row[engineer]" id="first-table">
                <tr>
                    <td>{:__('业绩')}</td>
                    <td>{:__('提成')}</td>
                    <td>{:__('工程师')}</td>
                </tr>
                <tr>
                    <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                </tr>
            </table>
            <textarea name="row[engineer]" class="form-control" cols="30" rows="5" style="display: none;"></textarea>
            <script id="basictpl" type="text/html">
                <tr class="form-inline">
                    <td><input type="text" name="<%=name%>[<%=index%>][achievement]" class="form-control" size="15" value="<%=row.achievement%>" placeholder="业绩"/></td>
                    <td><input type="text" name="<%=name%>[<%=index%>][commission]" class="form-control" size="15" value="<%=row.commission%>" placeholder="提成"/></td>
                    <td><input type="text" name="<%=name%>[<%=index%>][user_id]" class="form-control selectpage" data-params='{"type":"1"}' data-source="user/user/selectpage3" data-field="nickname" value="<%=row.user_id%>" placeholder="工程师"/></td>
                    <td>
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    </td>
                </tr>
            </script>
        </div>
    </div>
    <div class="all_one_div"><b>销售</b></div>
    <div class="form-group row">
        <div class="col-xs-12">
            <table class="table fieldlist" data-template="saletpl" data-name="row[sale]" id="sale-table">
                <tr>
                    <td>{:__('业绩')}</td>
                    <td>{:__('提成')}</td>
                    <td>{:__('销售')}</td>
                </tr>
                <tr>
                    <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                </tr>
            </table>
            <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
            <textarea name="row[sale]" class="form-control" cols="30" rows="5"  style="display: none;"></textarea>
            <script id="saletpl" type="text/html">
                <tr class="form-inline">
                    <td><input type="text" name="<%=name%>[<%=index%>][achievement]" class="form-control" size="15" value="<%=row.achievement%>" placeholder="业绩"/></td>
                    <td><input type="text" name="<%=name%>[<%=index%>][commission]" class="form-control" size="15" value="<%=row.commission%>" placeholder="提成"/></td>
                    <td><input type="text" name="<%=name%>[<%=index%>][user_id]" class="form-control selectpage" data-params='{"type":"2"}' data-source="user/user/selectpage3" data-field="nickname" value="<%=row.user_id%>" placeholder="销售"/></td>
                    <td>
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    </td>
                </tr>
            </script>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<div class="panel panel-default panel-intro">
    <div class="panel-heading"><div class="panel-lead">
        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
        <span>提成记录</span></div></div>
    <input type="hidden" value="{$ids}" name="warranty_id" id="warranty_id">
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                           data-operate-edit="{:$auth->check('suborder/edit')}"
                           data-operate-del="{:$auth->check('suborder/del')}"
                           width="100%">
                    </table>
                </div>
            </div>

        </div>
    </div>
</div>